const path = require('path')
module.exports = {
  devServer: {
    port: 9527,
    proxy: {
      // 反向代理
      '/api': {
        target: 'http://rap2api.taobao.org/app/mock/289378',
        changeOrigin: true,
        pathRewrite: {
          '^/api': '/api'
        }
      }
    }
  },
  // 修改babel的配置
  babel: {
    presets: [],
    plugins: [],
    loaderOptions: {}
  },
  webpack: {
    // 自定义webpack自己的配置
    alias: {
      // 路径别名
      "@": path.join(__dirname, 'src'),
      "@pages": path.join(__dirname, 'src/pages'),
      "@api": path.join(__dirname, 'src/api'),
      "@utils": path.join(__dirname, 'src/utils'),
      "@routes": path.join(__dirname, 'src/routes')
    }
  }
}